﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucAddNewItem.ascx.cs"
    Inherits="Admin_ucControl_ucAddNewItem" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit.HTMLEditor"
    TagPrefix="cc1" %>
<style type="text/css">
    .style1
    {
        width: 50%;
        height: 30px;
    }
    .style2
    {
        height: 30px;
    }
</style>
<div id="postedit" class="clearfix">
    <h2 class="ico_mug">
        ADD NEW PRODUCTS</h2>
    <table class="yui" width="100%">
        <tr>
            <td style="width: 50%" colspan="2">
                <b>Information Product</b><br />
                <br />
                <table width="100%">
                    <tr>
                        <td style="width: 50%">
                            <table class="yui" style="border: 0px; width: 100%">
                                <tr>
                                    <td class="style1">
                                        Product Number
                                    </td>
                                    <td class="style2">
                                        <asp:TextBox ID="txtNumItem" runat="server" Style="width: 80%"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*"
                                            ControlToValidate="txtNumItem" ValidationGroup="save"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Product Name
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtTenSP" runat="server" Style="width: 80%"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="*"
                                            ControlToValidate="txtTenSP"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Category
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="drCategory" runat="server" Style="width: 80%">
                                        </asp:DropDownList>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="*"
                                            ControlToValidate="drCategory" ValidationGroup="save"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Repeat
                                    </td>
                                    <td>
                                    
                                        <asp:TextBox ID="txtRepeat" runat="server" Style="width: 80%"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="*"
                                            ControlToValidate="txtRepeat" ValidationGroup="save"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        RollSize
                                    </td>
                                    <td>
                                      
                                        <asp:TextBox ID="txtRollSize" runat="server" Style="width: 80%"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="*"
                                            ControlToValidate="txtRollSize" ValidationGroup="save"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td>
                            <table class="yui" style="border: 0px; width: 100%; vertical-align: top;">
                                <tr>
                                    <td class="style1">
                                        BaseSellingPrice
                                    </td>
                                    <td class="style1">
                                        <asp:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" FilterType="Numbers"
                                            TargetControlID="txtPrice">
                                        </asp:FilteredTextBoxExtender>
                                        <asp:TextBox ID="txtPrice" runat="server" Width="80%"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="*"
                                            ControlToValidate="txtPrice" ValidationGroup="save"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Sale Products
                                    </td>
                                    <td>
                                        <asp:RadioButton ID="rdYes" runat="server" Text="Yes" GroupName="khuyenmai" Width="80px"
                                            onclick="CheckFee()" />
                                        <asp:RadioButton ID="rdNo" Text="No" GroupName="khuyenmai" runat="server" Checked="true"
                                            onclick="CheckFee()" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="lbmakhuyenmai" runat="server" Text="Sale Off"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:FilteredTextBoxExtender ID="FilteredTextBoxExtender3" runat="server" FilterType="Numbers"
                                            TargetControlID="txtmakhuyenmai">
                                        </asp:FilteredTextBoxExtender>
                                        <asp:TextBox ID="txtmakhuyenmai" runat="server" AutoPostBack="True" OnTextChanged="txtmakhuyenmai_TextChanged"
                                            Width="80%"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="lbGiaKhuyenmai" runat="server" Text="PriceTaxCode"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtPricekhuyenmai" runat="server" Width="80%"></asp:TextBox>
                                    </td>
                                </tr>
                                
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" style="padding-top: 8px; padding-left: 0px">
                            <b>
                                <asp:Label ID="Label1" runat="server" Text="Product Description"></asp:Label></b>
                            <br />
                            <cc1:Editor ID="edttsp" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" style="padding-top: 8px; padding-left: 0px">
                           
                            
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right">
                            <asp:Button ID="btnLuu" runat="server" Text="Save" OnClick="btnLuu_Click" ValidationGroup="save" />
                        </td>
                        <td>
                            <asp:Button ID="btnCancel" runat="server" Text="Cancel" OnClick="btnCancel_Click" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <br />
    <b>
        <asp:Label ID="lbl1" runat="server" Text="Product Image"></asp:Label><br />
    </b>
    <br />
    <asp:GridView ID="grdImgItems" runat="server" AutoGenerateColumns="False" CssClass="yui"
        EmptyDataText="No Image" Width="500px">
        <Columns>
            <asp:ImageField DataImageUrlField="ImageURL" DataImageUrlFormatString="~/Admin/Img/Items/{0}"
                HeaderText="Image Product">
                <ControlStyle Height="80px" />
                <ItemStyle HorizontalAlign="Center" />
            </asp:ImageField>
            <asp:TemplateField HeaderText="Delete">
                <ItemTemplate>
                    <asp:ImageButton ID="btnDelImg" runat="server" CausesValidation="false" CommandArgument='<%# Eval("IDImage") %>'
                        CommandName="delete" ImageUrl="~/Admin/img/Del.png" OnClick="btnDelImg_Click" />
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Top" />
            </asp:TemplateField>
        </Columns>
        <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" HorizontalAlign="Center" />
        <EmptyDataTemplate>
            Not found Images
        </EmptyDataTemplate>
        <SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
        <HeaderStyle BackColor="Tan" Font-Bold="True" Height="30px" />
        <AlternatingRowStyle BackColor="PaleGoldenrod" />
    </asp:GridView>
    <br />
    <div>
        <asp:Label ID="lblMessage" runat="server" Style="color: Red"></asp:Label>
        <table id="tableImage" runat="server" style="line-height: 30px; width: 50%">
            <tr>
                <td>
                    Product Image
                </td>
                <td>
                    <asp:FileUpload ID="fileUpload" runat="server" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ErrorMessage="*" ControlToValidate="fileUpload" ValidationGroup="up"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <%--<tr>
                <td>
                    Image Product Detai
                </td>
                <td>
                    <asp:RadioButton ID="Yes" runat="server" Checked="true" Text="Yes" onclick="check()"
                        GroupName="checkbox" /><asp:RadioButton ID="No" runat="server" Text="No" onclick="check()"
                            GroupName="checkbox" />
                </td>
            </tr>--%>
            <%--<tr>
                <td colspan="2">
                    <span style="font-weight: bold;">
                        Upload Image View</span>
                    <asp:Panel ID="panelImageView" runat="server">
                        <asp:Label ID="lbImageView" runat="server"></asp:Label><br />
                        <asp:HyperLink ID="hid" runat="server" Text="Upload" NavigateUrl="~/Admin/ImageView.aspx?&keepThis=true&TB_iframe=true&width=600&height=510"
                            CssClass="thickbox" ToolTip="Upload Image View"></asp:HyperLink>
                    </asp:Panel>
                </td>
            </tr>--%>
            <%--<tr>
                <td colspan="2">
                    <span style="font-weight: bold;">
                        Upload Image Detail</span>
                    <asp:Panel ID="panel" runat="server">
                        <asp:Label ID="lbImageDetail" runat="server"></asp:Label><br />
                        <asp:HyperLink ID="HyperLink1" runat="server" Text="Upload" NavigateUrl="~/Admin/ImageDetail.aspx?&keepThis=true&TB_iframe=true&width=600&height=510"
                            CssClass="thickbox" ToolTip="Upload Image Detail"></asp:HyperLink>
                    </asp:Panel>
                </td>
            </tr>--%>
        </table>
    </div>
    <%--<asp:Button ID="btnUpload" runat="server" OnClick="btnUpload_Click" Text="UpLoad" />--%>
    <%--<div class="left form_sidebar"></div>--%>
    <asp:Button ID="btnUpLoadImage" runat="server" Text="Upload" OnClick="btnUpLoadImage_Click" ValidationGroup="up" />
</div>

<script language="javascript" type="text/javascript">
    function CheckFee() {
        var rdYes = document.getElementById("<%=rdYes.ClientID %>");
        var rdNo = document.getElementById("<%=rdNo.ClientID %>");
        var txtmakhuyenmai = document.getElementById("<%=txtmakhuyenmai.ClientID %>");
        var txtPricekhuyenmai = document.getElementById("<%=txtPricekhuyenmai.ClientID %>");

        if (rdNo.checked == true) {
            txtmakhuyenmai.disabled = true;
            txtPricekhuyenmai.disabled = true;
        }
        else {
            txtmakhuyenmai.disabled = false;
            txtPricekhuyenmai.disabled = false;
        }
    }
    
</script>

